// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
jQuery.ajaxSetup({ 
	"beforeSend": function(request) {
		request.setRequestHeader("Accept", "text/javascript");
	}
});

$(document).ready(function() {
	$(".delete-link").live("click", function(event)
	{
		var confirm_message = "Você realmente gostaria de apagar esse dado?\nObs: essa operação é permanente"
		
		if (this.confirm_message)
			var confirm_message = this.confirm_message;
		
		if (confirm(confirm_message)) {
			$.ajax({
				type: "DELETE",
				url: this.href,
				dataType: "script"
			});
		}
		
		return false;
	});
});